// Author: wsfuyibing <682805@qq.com>
// Date: 2025-04-28

package kind

// Deleted
// 删除状态.
type Deleted int

const (
	DeletedNo Deleted = iota
	DeletedYes
)

var (
	deletedTexts = map[Deleted]string{
		DeletedNo:  "未删除",
		DeletedYes: "已删除",
	}
	deletedUndefined = "未知"

	deletedFlags = map[Deleted]string{
		DeletedNo:  "undeleted",
		DeletedYes: "deleted",
	}
	deletedUnknownFlag = "unknown"
)

func (o Deleted) Flag() string {
	if str, ok := deletedFlags[o]; ok {
		return str
	}
	return deletedUnknownFlag
}

func (o Deleted) Int() int { return int(o) }

func (o Deleted) IsNo() bool  { return o == DeletedNo }
func (o Deleted) IsYes() bool { return o == DeletedYes }

func (o Deleted) Text() string {
	if str, ok := deletedTexts[o]; ok {
		return str
	}
	return deletedUndefined
}
